package com.example.threadpool;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class MainTest {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        ExecutorService executorService = Executors.newFixedThreadPool(1);

        executorService.submit(new task());
        executorService.execute(new task());

    }

}

class task implements Runnable {

    @Override
    public void run() {
        System.out.println("task方法！！！");
        throw new RuntimeException("手动抛出异常");
    }
}
